/////////////////////////////////////////////////////////////////////////////
// Name:        application.h
// Purpose:     
// Author:      Brant Young
// Modified by: 
// Created:     Mon May 14 21:43:02 2007
// RCS-ID:      
// Copyright:   Copyright (c) daodict.com 2007
// Licence:     GPL 2.0
/////////////////////////////////////////////////////////////////////////////

#pragma once

#include <wx/image.h>
#include "../core/cfgmgr.h"
#include "../core/dictmgr.h"
#include "../core/thememgr.h"
#include "../core/taskmgr.h"

class SplashFrame;
class wxSingleInstanceChecker;

/**
 * Application class declaration
 */
class Application: public wxApp
{
public:
    /// Initialises the application
    virtual bool OnInit();

    /// Called on exit
    virtual int OnExit();
    
protected:
	void _init_log();
	
	bool _init_single_instance();
	
	static void* _clean_logfile_taskfunc(void* data);
	static void* _after_enter_mainloop_taskfunc(void* data);
	
	wxFFile* _p_logfile;
	SplashFrame* p_splash_frame;
	wxSingleInstanceChecker* p_checker;
	
	static Application* this_ptr;

};


DECLARE_APP(Application)

